package com.handle.system.api.entity;

import com.baomidou.mybatisplus.annotation.FieldFill;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.handle.common.core.valid.AddGroup;
import com.handle.common.core.valid.OtherGroup;
import com.handle.common.core.valid.UpdateGroup;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;

import javax.validation.constraints.NotNull;
import java.io.Serializable;
import java.time.LocalDateTime;

/**
 * <p>
 * 系统角色表
 * </p>
 *
 * @author zhangqing
 * @since 2021-03-05
 */
@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
public class SysRole implements Serializable {

    /**
     * 数据权限标示
     */
    @NotNull(message = "数据权限标示不能为空", groups = {AddGroup.class})
    public String dataScope;

    @TableId
    @NotNull(message = "id不能为空", groups = {UpdateGroup.class, OtherGroup.class})
    private Long id;

    /**
     * 租户code
     */
    @NotNull(message = "租户code不能为空", groups = {AddGroup.class})
    private String tenantCode;
    /**
     * 角色名称
     */
    @NotNull(message = "角色名称不能为空", groups = {AddGroup.class})
    private String roleName;
    /**
     * 角色code
     */
    @NotNull(message = "角色代码不能为空", groups = {AddGroup.class})
    private String roleCode;
    /**
     * 显示顺序
     */
    @NotNull(message = "排序序号不能为空", groups = {AddGroup.class})
    private int roleSort;
    /**
     * 角色状态（1正常 0停用）
     */
    @NotNull(message = "角色状态不能为空", groups = {AddGroup.class})
    private Boolean status;

    /**
     * 删除标志（0代表存在 1代表删除）
     */
    private Boolean delFlag;

    /**
     * 创建者
     */
    private Long createStaff;

    /**
     * 创建时间
     */
    @TableField(fill = FieldFill.INSERT)
    private LocalDateTime createTime;

    /**
     * 更新者
     */
    private Long updateStaff;

    /**
     * 更新时间
     */
    @TableField(fill = FieldFill.UPDATE)
    private LocalDateTime updateTime;

    /**
     * 备注
     */
    private String remark;


    public static final String ID = "id";

    public static final String TENANT_CODE = "tenant_code";

    public static final String ROLE_NAME = "role_name";

    public static final String ROLE_CODE = "role_code";

    public static final String ROLE_SORT = "role_sort";

    public static final String STATUS = "status";

    public static final String DEL_FLAG = "del_flag";

    public static final String CREATE_BY = "create_by";

    public static final String CREATE_TIME = "create_time";

    public static final String UPDATE_BY = "update_by";

    public static final String UPDATE_TIME = "update_time";

    public static final String REMARK = "remark";

}
